﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace PropertyManagment.entity.dto {
    /// <summary>
    /// 多页查询实体类
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class Page<T> {
        /// <summary>
        /// 总页数
        /// </summary>
        public int total = 0;

        /// <summary>
        /// 每页显示条数，默认 10
        /// </summary>
        public int size = 10;

        /// <summary>
        /// 当前页
        /// </summary>
        public int current = 1;

        /// <summary>
        /// 查询数据列表
        /// </summary>
        public List<T> records = new List<T>();

        /// <summary>
        /// 分页构造函数
        /// </summary>
        /// <param name="current">当前页</param>
        /// <param name="size">每页显示条数</param>
        public Page(int current, int size) {
            this.current = current;
            this.size = size;
            this.total = 0;
        }

        /// <summary>
        /// 分页构造函数
        /// </summary>
        /// <param name="current">当前页</param>
        /// <param name="size">每页显示条数</param>
        /// <param name="total">总页数</param>
        public Page(int current, int size, int total) {
            this.current = current;
            this.size = size;
            this.total = total;
        }
    }
}
